﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BLL.Wrapper;
using System.Collections.Generic;
using DAL.DateSet;
using DAL.DateSet.ClassAppendTableAdapters;

public partial class BrandLoad : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            return;
        }
        TypeWrapper wrapper = new TypeWrapper();
        List<string> list = new List<string>();
        list = wrapper.getSubName("后台管理");
        Typelist.DataSource = list;
        list.Add("不选");
        Typelist.DataBind();
        list.Clear();
        list = wrapper.getSubName(Typelist.SelectedValue);
        TypeClass.DataSource = list;
        TypeClass.DataBind();
    }

    protected void TypeSelecetChanged(object sender, EventArgs e)
    {
        string name = Typelist.SelectedValue;
        TypeWrapper wrapper = new TypeWrapper();
        List<string> list = new List<string>(); 
        list = wrapper.getSubName(name);
        TypeClass.DataSource = list;
        TypeClass.DataBind();
    }

    protected void ClassSelecetChanged(object sender, EventArgs e)
    {
       
    }

    protected void QueryClick(object sender, EventArgs e)
    {
         BrandWrapper wrapper = new BrandWrapper();
         Brand.BrandDataTable table = new Brand.BrandDataTable();
         Brand.BrandRow row ;
         row = table.NewBrandRow();
         row.brandName = GoodsNameInput.Text;
         row.brandCreateDate = DateTime.Now;
         row.brandEnglishName = TextBox1.Text;
         row.brandDesc = Des.Text;
         row.brandCreator = "";
         row.brandOrder = Convert.ToInt32(TextBox2.Text);
         row.brandPicSrc = Server.MapPath("Image")+"\\" + uplode.PostedFile.FileName;
         uplode.SaveAs(row.brandPicSrc);
         wrapper.addARecord(row); 
    }
}
